package edu.hubu.book;


import edu.hubu.book.domain.User;
import edu.hubu.book.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;

@SpringBootTest
public class testservice {

    @Autowired private UserService us;

    @Test
    public void testregist() {
        User user = new User();
        user.setUsername("wdhsg");
        user.setPassword("12344321");
        user.setEmail("wdh3845@163.com");
        user.setCode(null);
        boolean b = us.regist(user);
        System.out.println(b);
    }

    @Test
    public void testlogin() {
        User user = new User();
        user.setUsername("wdhsg");
        user.setPassword("12344321");
        user.setCode(null);
        User loginuser = us.login(user);
        System.out.println(loginuser);
    }

    @Test
    public void testactive() {
        boolean active = us.active("1c2c26379b004986aabd3c0c7780c7ce");
        System.out.println(active);
    }
}
